﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Prism.MefExtensions;
using CodeC.Interfaces.UI;
using System.ComponentModel.Composition.Hosting;
using System.Windows;
using CodeC.Models;
using CodeC.Utilities;

namespace CodeC.UI
{
    public class Bootstrapper : MefBootstrapper
    {
        protected override System.Windows.DependencyObject CreateShell()
        {
            return (System.Windows.DependencyObject)(new Window());
        }


        protected override void ConfigureAggregateCatalog()
        {
            base.ConfigureAggregateCatalog();
            this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Bootstrapper).Assembly));
            this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(CodeCModel).Assembly));
            this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(CodeCHelper).Assembly));
        }

        /// <summary>
        /// Returns the CodeCView 
        /// </summary>
        public object Content
        {
            get
            {
                var viewModel = this.Container.GetExportedValue<ICodeCViewModel>();
                return ((ICodeCViewModel)viewModel).View;
            }
        }


    }
}
